home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 13406 < prev    next >
Encoding:
Text File  |  1996-08-05  |  948 b   |  43 lines

  1. Path: lrz-muenchen.de!news
  2. From: Ralph Reichart <reichart@informatik.tu-muenchen.de>
  3. Newsgroups: comp.lang.c
  4. Subject: File problem with Watcom C/C++ 10.5
  5. Date: 7 Apr 1996 22:26:04 GMT
  6. Organization: Leibniz-Rechenzentrum, Muenchen (Germany)
  7. Distribution: world
  8. Message-ID: <4k9fds$4fs@sparcserver.lrz-muenchen.de>
  9. NNTP-Posting-Host: line6d.ppp.lrz-muenchen.de
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.22 (Windows; I; 16bit)
  14.  
  15. hi,
  16.  
  17. i have a big problem. i'm trying to open a file with fopen. the program 
  18. looks like this:
  19.  
  20. #include <stdlib.h>
  21. #include <stdio.h>
  22.  
  23. main()
  24. {
  25.  FILE *Datei;
  26.  
  27.  Datei = fopen("\autoexec.bat", "r");
  28.  if (Datei == NULL)
  29.  {
  30.   printf("\nSHIT!!");
  31.   exit(1);
  32.  };
  33.  fclose(Datei);
  34. }
  35.  
  36. i'm sorry, but i can't open it. i always have the value -1 or 1 in errno.
  37. yes, the file exists, but it doesn't matter. it never works.
  38. can somebody please help me??
  39.  
  40. ralphy
  41.  
  42.  
  43.